package com.cooper.scraper.show;

import com.cooper.android.comm.BitmapUtils;
import com.cooper.scraper.R;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class CrystalFanartImgStrategy implements FanartImgStrategy {
	
	private static CrystalFanartImgStrategy instance;
	
	public static CrystalFanartImgStrategy getInstance(){
		if (instance == null){
			instance = new CrystalFanartImgStrategy();
		}
		return instance;
	}

	private Bitmap overlay = null;

	private static final float ROUND_RADIUS_SCALE = 15;

	private CrystalFanartImgStrategy() {
		super();
	}

	@Override
	public Bitmap handleFanartImg(Context context, Bitmap fanartImg) {
		if (overlay == null) {
			overlay = BitmapFactory.decodeResource(context.getResources(),
					R.drawable.resource_overlay_crystal);
		}

		return BitmapUtils.reflectedFanart(BitmapUtils.drawOverlay(
				BitmapUtils.roundRect(fanartImg, fanartImg.getWidth()
						/ ROUND_RADIUS_SCALE), overlay, 0, true));
	}

}
